package eom.example.elasticsearch.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

import lombok.Data;

/**
 * 
 * @TableName cms_content
 */
@TableName(value ="cms_content")
@Data
public class CmsContent implements Serializable {
    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 标题
     */
    @TableField(value = "title_name")
    private String titleName;

    /**
     * 标签
     */
    @TableField(value = "tags")
    private String tags;

    /**
     * 作者
     */
    @TableField(value = "author")
    private String author;

    /**
     * 副标题
     */
    @TableField(value = "sub_title")
    private String subTitle;

    /**
     * 内容
     */
    @TableField(value = "content")
    private String content;

    /**
     * 创建时间
     */
    @TableField(value = "createDate")
    private Date createDate=new Date();

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CmsContent that = (CmsContent) o;
        return Objects.equals(id, that.id) &&
                Objects.equals(titleName, that.titleName) &&
                Objects.equals(tags, that.tags) &&
                Objects.equals(author, that.author) &&
                Objects.equals(subTitle, that.subTitle) &&
                Objects.equals(content, that.content) &&
                Objects.equals(createDate, that.createDate);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, titleName, tags, author, subTitle, content, createDate);
    }
}